<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jq/jquery-3.6.4/jquery-3.6.4.min.js"></script>
</head>
<body>
    <div id="mydiv"></div>


    <script>
        var obj={
            id:1001,
            name:"alice",
            arrs:["吃饭","玩手机","打人"]
        };
        var p=$("<p>"+obj.id+"</p><p>"+obj.name+"</p>");
        var li=$("<li></li>");
        for(var i=0;i<obj.arrs.length;i++){
            var span=$("<span>"+obj.arrs[i]+"</span>");
            span.appendTo(li);
        }
        p.appendTo($("div"));
        li.appendTo($("div"));
    </script>
</body>
</html>